package uk.co.BexhillWeb.MediaManager.PluginSystem;

import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import uk.co.BexhillWeb.MediaManager.Core;
import uk.co.BexhillWeb.MediaManager.Managers.PluginManager;
 
public class PluginFactory
{
    public static PluginInterface createPluginService()
    {
        addPluginJarsToClasspath();
        return StandardPluginService.getInstance();
    }
 
    private static void addPluginJarsToClasspath()
    {
        try
        {
            PluginManager.addDirToClasspath(new File("plugins"));
        } catch (IOException ex)
        {
            Logger.getLogger(PluginFactory.class.getName()).log(
                Level.SEVERE, null, ex);
        }
    }
}